﻿/*系统自动生成的 sql server 版业务类
* 开发时间：2010-4-29 15:05:05
* 版权所有：andy
* 其他联系：
* Email：yhailong@sina.com
* MSN：yhailong@hotmail.com
* QQ:9502855
* 声明：仅限于您自己使用，不得进行商业传播，违者必究！
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.SqlClient;


namespace EZCRS.HCMS.Bll
{
    /// <summary>
    /// HCRS_CorpUser 的数据库方法
    /// </summary>
    public class BllHCRS_CorpUser
    {
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="strCcolumn">查询的字段名，空则返回全部</param>
        /// <param name="currentPage">当前页数</param>
        /// <param name="pageCount">总页数</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="orderBy">排序字段</param>
        /// <param name="recordCount">总记录数</param>
        /// <returns></returns>
        public List<HCRS_CorpUser> GetAllByPage(string strColumn,int currentPage,string strWhere,string orderBy,out int pageCount,out int recordCount)
        {
            if(strWhere=="")
                strWhere=" 1=1 ";
            if(strColumn == "")
                strColumn = " * ";
            if(orderBy == "")
                orderBy = " id desc ";

            return new Sql_HCRS_CorpUser().GetAllByPage(strColumn,currentPage, strWhere,orderBy, out pageCount,out recordCount);
        }


        /// <summary>
        /// 获得所有符合条件的记录
        /// </summary>
        /// <param name="strSearch">查询条件</param>
        /// <returns></returns>
        public List<HCRS_CorpUser> GetItem(string strSearch)
        {
            return new Sql_HCRS_CorpUser().GetAll(strSearch,"");
        }


        /// <summary>
        /// 获得所有符合条件的记录
        /// </summary>
        /// <param name="strSearch">查询条件</param>
        /// <param name="orderBy">排序规则</param>
        /// <returns></returns>
        public List<HCRS_CorpUser> GetItem(string strSearch,string orderBy)
        {
            return new Sql_HCRS_CorpUser().GetAll(strSearch,orderBy);
        }


        /// <summary>
        /// 获得一条记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public HCRS_CorpUser GetItem(int id)
        {
            return new Sql_HCRS_CorpUser().GetItem(id);
        }


        #region 删除
        /// <summary>
        /// 删除一条记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeleteItem(int id)
        {
            return new Sql_HCRS_CorpUser().DeleteItem(id);
        }


        /// <summary>
        /// 删除一系列数据
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        public bool DeleteItem(string idList)
        {
            return new Sql_HCRS_CorpUser().DeleteItem(idList);
        }
        #endregion


        /// <summary>
        /// 添加或修改
        /// </summary>
        /// <param name="_log"></param>
        /// <returns></returns>
        public bool InsertorUpdateitem(HCRS_CorpUser DataItem)
        {
            return new Sql_HCRS_CorpUser().InsertOrUpdate(DataItem);
        }



        #region DataSet 老方法
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="strColumn">查询的字段列</param>
        /// <param name="currentPage">当前页数</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="orderBy">排序条件</param>
        /// <param name="keyName">主键</param>
        /// <returns></returns>
        public DataSet GetallByPage(string strColumn, int currentPage, string strWhere, string orderBy, string keyName)
        {
            if (strWhere == "")
                strWhere = " 1=1 ";

            return new Sql_HCRS_CorpUser().GetAllByPage(strColumn,currentPage,strWhere,orderBy,keyName);
        }


        /// <summary> 
        /// 获取指定内容 
        /// </summary> 
        /// <param name="strColumn">指定字段</param> 
        /// <param name="strWhere">条件</param> 
        /// <param name="orderBy">排序规则</param> 
        /// <param name="totalRecord">记录条数，默认0=全部</param> 
        /// <returns></returns> 
        public DataTable GetAll(string strColumn, string strWhere, string orderBy,int totalRecord) 
        { 
            return new Sql_HCRS_CorpUser().GetAll(strColumn, strWhere, orderBy,totalRecord); 
        } 

        #endregion 



        #region 人工定义方法 by  

        #endregion 

    }
}
